package com.cqemme.comm.enums;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 86156
 */

public enum EnumSendMessageRole {
    CODE_ADMIN("CODE_ADMIN","管理员"),
    CODE_LEADER("CODE_LEADER","领导"),
    CODE_TEACHER("CODE_TEACHER","老师"),
    CODE_PARENT("CODE_PARENT","家长"),
    CODE_SECURITY("CODE_SECURITY","保安"),
    CODE_SECURITY_MANAGER("CODE_SECURITY_MANAGER","保安队长");

    public static String getText(String code) {
        EnumSendMessageRole[] p = values();
        for (int i = 0; i < p.length; ++i) {
            EnumSendMessageRole type = p[i];
            if (type.getCode().equals(code)) {
                return type.getText();
            }
        }
        return null;
    }

    public static Map<String,String> getMap() {
        Map<String,String> map=new HashMap<String,String>();
        EnumSendMessageRole[] p = values();
        for (int i = 0; i < p.length; ++i) {
            EnumSendMessageRole type = p[i];
            map.put(type.getCode(), type.getText());
        }
        return map;
    }


    private String code;

    private String text;

    private EnumSendMessageRole(String code, String text) {
        this.code = code;
        this.text = text;
    }

    public String getCode() {
        return this.code;
    }

    public String getText() {
        return this.text;
    }

}
